var SixcitAssistant = Class.create(AbstractModule, {


setupWidgets: function() {

		//About
		this.controller.setupWidget(Mojo.Menu.appMenu, {
			omitDefaultItems: true
		}, {
			visible: true,
			items: [
      		Mojo.Menu.editItem,
			{ label: "Disclaimer", command: "do-disclaimer" },					
				{ label: "License", command: "do-license" },
				{ label: "Help", command: "do-help" }
			]
		});
	
			this.controller.setupWidget("count", {
			label: "Count 20 to 1",
			choices: [
				{ label: "Correct", value: 0},
				{ label: "1 error", value: 2},
  			{ label: "> 1 error", value: 4}
			]
		}, this.countModel = {
			value: 0
		});
		
				this.controller.setupWidget("saymonths", {
			label: "Months in rev",
			choices: [
				{ label: "Correct", value: 0},
				{ label: "1 error", value: 2},
  			{ label: "> 1 error", value: 4}
			]
		}, this.saymonthsModel = {
			value: 0
		});
		
				this.controller.setupWidget("address", {
			label: "Rpt address",
			choices: [
				{ label: "Correct", value: 0},
				{ label: "1 error", value: 2},
  			{ label: "2 errors", value: 4},
  			{ label: "3 errors", value: 6},
  			{ label: "4 errors", value: 8},
  			{ label: "All wrong", value: 10}												
			]
		}, this.addressModel = {
			value: 0
		});
	

	this.toggleModel = {
		yearCHK: false
			};
	this.toggleModel = {
			monthCHK: false
			};
			
	this.toggleModel = {
			timeCHK: false
			};	


	this.controller.setupWidget("yearCHK", {
			modelProperty: "yearCHK"
		}, this.toggleModel);
	this.controller.setupWidget("monthCHK", {
			modelProperty: "monthCHK"
		}, this.toggleModel);
	this.controller.setupWidget("timeCHK", {
			modelProperty: "timeCHK"
		}, this.toggleModel);
			
},



	calculate: function() {
	var result = sixcitcalc(this.toggleModel.yearCHK,this.toggleModel.monthCHK,this.toggleModel.timeCHK,parseInt(this.countModel.value), parseInt(this.saymonthsModel.value), parseInt(this.addressModel.value));

	return "The score is " + result.sixcitscore + " which suggests " +result.severity;
	}
});





